//
//  SMHelper.h
//  DiDi
//
//  Created by huangtie on 2017/2/28.
//  Copyright © 2017年 Sinmore. All rights reserved.
//

#import <Foundation/Foundation.h>

@class DIOrder;

@interface SMHelper : NSObject

+ (UIBarButtonItem *)customBackBarItemWithTarget:(id)target
                                          action:(SEL)action;

+ (UIBarButtonItem *)customBarItemWithTitle:(NSString *)title
                                     target:(id)target
                                     action:(SEL)action;

+ (UIBarButtonItem *)customBarItemWithImageName:(NSString *)imageName
                                         target:(id)target
                                         action:(SEL)action;

+ (UIBarButtonItem *)searchBarItemWithTarget:(id)target
                                      action:(SEL)action;

+ (UIBarButtonItem *)collectBarItem:(BOOL)isCollect
                             target:(id)target
                             action:(SEL)action;

/**
 * 图文的文字
 */
+ (NSAttributedString *)textMatchImage:(NSString *)text
                              textFont:(UIFont *)textFont
                             textColor:(UIColor *)textColor
                                 image:(NSString *)image
                            inserIndex:(NSInteger)inserIndex
                               offsetY:(CGFloat)offsetY
                             imageSize:(CGSize)imageSize;

/**
 * 文字 + ▽
 */
+ (NSAttributedString *)textMatchArrowDown:(NSString *)text;


/*
 *检查相机权限
 */
+ (BOOL)checkCameraAuthority:(void (^)(BOOL isPass))callback;

/*
 *检查相册权限
 */
+ (BOOL)checkPhotoAuthority:(void (^)(BOOL isPass))callback;

/*
 *开启权限提醒
 */
+ (void)openAuthorityWithString:(NSString *)string;

/**
 * 画边线
 */
+ (void)buildLayerLine:(UIView *)view
                  edge:(UIEdgeInsets)edge
                 color:(UIColor *)color;

/**
 * 根据URL生产二维码
 */
+ (UIImage *)create2Dbarcode:(NSString *)linkString outputSize:(CGSize)size;

/**
 * 拉伸图片
 */
+ (UIImage *)resizableImage:(UIImage *)image;

@end
